home *** CD-ROM | disk | FTP | other *** search
/ MacHome 2001 June / MacHome Magazine Demo Disc June 2001.iso / Stuff / Software / Tools / Substitute Pro 1.8.5 / Yellow Extension Toolkit / YE proto.h < prev    next >
Encoding:
Text File  |  2000-02-01  |  3.5 KB  |  92 lines  |  [TEXT/CWIE]

  1. //•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  2. //    YELLOW EXTENSION TOOLKIT
  3. //    File Name:    YE proto.h
  4. //    © 1998-2000 by Rocco Moliterno-Yellowsoft. All Right Reserved
  5. //•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  6.  
  7. #pragma once
  8.  
  9. #ifdef __cplusplus
  10. extern "C" {
  11. #endif
  12.  
  13. #define kYellowExtensionType    'ExRo'    
  14. #define kYellowExtensionCreator '/RoW'    
  15. #define kYellowCodeResTypePPC    'YeEx'    
  16. #define kYellowCodeResType68k    'Ye68'    
  17. #define kYellowCodeResID         128
  18.         
  19.  
  20. #if PRAGMA_ALIGN_SUPPORTED
  21. #pragma options align=mac68k
  22. #endif
  23.  
  24. //Put here the signature of your application
  25. enum{
  26.     yellowSignature     = FOUR_CHAR_CODE('yllw'),
  27.     substituteSignature = FOUR_CHAR_CODE('sbst')
  28. };
  29.  
  30. typedef FourCharCode YESignature;
  31.  
  32. //If you don't use WASTE leave untouched the declaration of below.
  33. //If you use WASTE, instead, comment it then include "WASTE.h" to file "YE main.c"
  34. typedef struct OpaqueWEReference *WEReference;
  35.  
  36. struct YEBlockRec{
  37.     YESignature  signature;      // <--> Sanity: the signature of calling application.
  38.                                  //      The extension should also set this field with the signature
  39.                                  //      of supported application!
  40.             
  41.     WEReference  sWaste;         // -->  from caller.It contains also a pointer to the related 
  42.                                  //      window you may retrieve it through WEGetInfo call. 
  43.     TEHandle     sText;          // -->  from caller
  44.     ListRef      sList;          // -->  from caller
  45.     AliasHandle  sFile;          // -->  from caller
  46.     
  47. //The following parameters are returned by extension
  48.     Boolean      rNew;           // <-- asks the calling application to create a new instance
  49.                                  //     in order to use following parameters.
  50.     Handle         rText;          // <-- this handle may contain a TEXT.
  51.                                                                   
  52.     Handle         rStyles;        // <-- this handle may contain a style.
  53.                                                                   
  54.     Handle         rSoup;          // <-- this handle may contain a SOUP. 
  55.                                  //     SOUPs are WASTE-related resources containing object as: 
  56.                                  //     PICTs, sounds, movies and more.
  57.  
  58.     ListRef      rList;          // <-- this handle may contain a *NEW* List
  59.                                  
  60.     AliasHandle  rFile;          // <-- this handle may contain a *NEW* AliasHandle
  61. };
  62. typedef struct YEBlockRec YEBlockRec,*YEBlockPtr,**YEBlockHandle;
  63.  
  64. //------------------------NOTE
  65. // YellowEdit (http://users.iol.it/yellowsoft/yellow.hyml) treats returned parameters, if valids,
  66. // as follows:
  67. // rNew    = create a new window.
  68. // rList   = will be disposed.
  69. // rText   = will be inserted with rStyles and rSoup.
  70. // rStyles = if rText isn't valid will be used to replace the current style.
  71. // rSoup   = if rText isn't valid will be used to replace the current SOUP.
  72. // rFile   = try to read it.
  73. //----------------------------------------------------------------------------
  74. // Remember, your extension may perform what you want, so, if your extension doesn't 
  75. // cooperate directly with YellowEdit (or with whatever application calls it) but performs
  76. // some its own work, you may completely ignore any field of above! Anyway,
  77. // in this case, would be better changing the signature field: if you set it, in example,
  78. // as '????', then YellowEdit neither try to analyze the returned data.
  79.  
  80. enum {    
  81.     uppYellowEntryProcInfo = kPascalStackBased   
  82.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(YEBlockPtr)))
  83. };
  84.  
  85. #if PRAGMA_ALIGN_SUPPORTED
  86. #pragma options align=reset
  87. #endif
  88.  
  89. #ifdef __cplusplus
  90. }
  91. #endif
  92.